/*###################################################################*
#
# MPGL Engine - CrossPlatform OpenGL Engine
# Copyright (C) 2014  Mitchell Pell
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
####################################################################*/

#ifndef LOGIC_THREAD_H
#define LOGIC_THREAD_H

#include "ThreadProcedure.h"
#include "../../../GLScene/GLAppScene.h"

using namespace mpgl_engine::scene;

namespace mpgl_engine{ namespace driver { namespace threading {

	class LogicThread : public ThreadProcedure
	{
		/*!------------------------------------------------------------
		*	@var	m_appScene
		*	@brief	Pointer to the GLApp for making draw calls.
		*/
		GLAppScene*	m_appScene;

	public:
		
		/*!------------------------------------------------------------
		*	@fn		RenderThread()
		*	@brief	Default Constructor
		*	@note	GLApp must be set before starting the thread or
		*			it will end.
		*/
		LogicThread():ThreadProcedure(){m_appScene = NULL;}
		
		/*!------------------------------------------------------------
		*	@fn		RenderThread(GLAppScene* scene)
		*	@brief	Overloaded Constructor
		*/
		LogicThread(GLAppScene* scene):ThreadProcedure(){m_appScene = scene;}
		
		/*!------------------------------------------------------------
		*	@fn		~RenderThread()
		*	@brief	Destructor
		*/
		~LogicThread(){}
		
		/*!------------------------------------------------------------
		*	@fn		SetAppScene(GLAppScene* scene)
		*	@brief	Sets the GLApp
		*/
		void SetAppScene(GLAppScene* scene){m_appScene = scene;}

		/*!------------------------------------------------------------
		*	@fn		void Procedure()
		*	@brief	Function called by boost::thread
		*/
		void Procedure();
	};
}}}

#endif